<template>
  <el-radio-group v-model="selected" size="mini" @change="onchange">
    <el-radio v-for="item in items" :key="item.id" :label="item.id">{{
      item.name
    }}</el-radio>
  </el-radio-group>
</template>

<script>
import _categories from "@/common/categories";

export default {
  props: {
    value: {
      type: Number | String,
      default: 0,
    },
  },

  watch: {
    value() {
      this.selected = this.value;
    },
  },

  data() {
    return {
      items: [
        { id: -1, name: "批评" },
        { id: 0, name: "普通" },
        { id: 1, name: "表扬" },
      ],
      selected: this.value,
    };
  },

  methods: {
    onchange(value) {
      this.$emit("input", value);
    },
  },
};
</script>

<style>
</style>